<style>
    .modal-content {
        width: 1350px;
        right: 380px;
    }
</style>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <h4>生产表导入导出维护</h4>
                    <div class="col-xs-2">
                        <input type="text" ng-model="info.schemaInfo" placeholder="选择数据库"
                               uib-typeahead="schema as schema.table_schema for schema in info.schemaList | filter:{table_schema:$viewValue}|limitTo:15"
                               typeahead-template-url="projectTemplate.html" class="form-control"
                               typeahead-show-hint="true" typeahead-min-length="0" typeahead-on-select="schemaSelect();"
                               typeahead-select-on-blur="true">
                    </div>
                    <div class="col-xs-2">
                        <input type="search" ng-model="search.table_name" style="width: 220px;"
                               placeholder="Search Table Name Here..."/>
                    </div>
                    <div class="col-xs-8">
                        <input type="checkbox" style="margin-left: 2%;" data-ng-model="info.isOnlyExport"
                               ng-true-value="true" ng-false-value="false" ng-click="tableData();"/>导出条件未维护
                        <input type="checkbox" style="margin-left: 2%;" data-ng-model="info.isOnlyClean"
                               ng-true-value="true" ng-false-value="false" ng-click="tableData();"/>清洗脚本未维护
                        <input type="checkbox" style="margin-left: 2%;" data-ng-model="info.isOnlyConfirm"
                               ng-true-value="true" ng-false-value="false" ng-click="tableData();"/>未确认行新增
                    </div>
                </div>
                <div class="box-body" style="height: 700px;overflow-y: auto;">
                    <table class="table table-hover table-bordered text-center">
                        <thead>
                        <tr>
                            <th>
                                数据库
                            </th>
                            <th>
                                表名
                            </th>
                            <th>
                                负责人
                            </th>
                            <th>
                                表说明
                            </th>
                            <th>
                                导出条件
                            </th>
                            <th>
                                清洗条件
                            </th>
                            <th>
                                行确认
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="i in info.tableShowList |filter:search">
                            <td>
                                {{i.table_schema}}
                            </td>
                            <td>
                                {{i.table_name}}
                            </td>
                            <td>
                                <a href="javascript:void(0)" class="btn-link"
                                   type="button" data-toggle="popover" data-placement="auto top"
                                   data-content="{{i.manager}}" data-trigger="hover">
                                    {{i.manager | limitTo: 20}}...</a>
                            </td>
                            <td>
                                {{i.purpose}}
                            </td>
                            <td>
                                <span ng-if="i.export_script != '' ">
                                    <a href="javascript:void(0)" ng-click="onExport(i);" style="color: #00a65a;"
                                       class="btn-link" type="button">
                                        已维护
                                    </a>
                                </span>
                                <span ng-if="i.export_script == '' " style="color: #c9302c;">
                                    <a href="javascript:void(0)" ng-click="onExport(i);" style="color: #c9302c;"
                                       class="btn-link" type="button">
                                        未维护
                                    </a>
                                </span>
                            </td>
                            <td>
                                <span ng-if="i.is_need_clean == 'Y' && i.clean_script != ''">
                                    <a href="javascript:void(0)" ng-click="onClean(i);" style="color: #00a65a;"
                                       class="btn-link" type="button">
                                        已维护
                                    </a>
                                </span>
                                <span ng-if="i.is_need_clean == 'Y' && i.clean_script == ''">
                                    <a href="javascript:void(0)" ng-click="onClean(i);" style="color: #c9302c;"
                                       class="btn-link" type="button">
                                        未维护
                                    </a>
                                </span>
                                <span ng-if="i.is_need_clean == 'N' ">
                                    <a href="javascript:void(0)" ng-click="onClean(i);" style="color:#5e5e5e;"
                                       class="btn-link" type="button">
                                        无需维护
                                    </a>
                                </span>
                            </td>
                            <td>
                                <span ng-if="i.is_check_rows == 'Y' && i.check_rows == '1'">
                                    <a href="javascript:void(0)" ng-click="onCheckRow(i);" style="color: #00a65a;"
                                       class="btn-link" type="button">
                                        已维护
                                    </a>
                                </span>
                                <span ng-if="i.is_check_rows == 'Y' && (i.check_rows == '' || i.check_rows == '0')">
                                    <a href="javascript:void(0)" ng-click="onCheckRow(i);" style="color: #c9302c;"
                                       class="btn-link" type="button">
                                        未维护
                                    </a>
                                </span>
                                <span ng-if="i.is_check_rows == 'N' ">
                                    <a href="javascript:void(0)" ng-click="onCheckRow(i);" style="color:#5e5e5e;"
                                       class="btn-link" type="button">
                                        无需维护
                                    </a>
                                </span>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/ng-template" id="projectTemplate.html">
    <a>
        <span ng-bind-html="match.label | uibTypeaheadHighlight:query"></span>
    </a>
</script>
<script type="text/ng-template" id="ProdExport.html">
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header" style="margin-top:1px;">
                        <br>
                        <uib-accordion close-others="false">
                            <uib-accordion-group heading="导出维护" is-open="true">
                                <table width="95%">
                                    <tbody>
                                    <tr style="width: 200px;">
                                        <td> 数据库:</td>
                                        <td>
                                            {{info.exportInfo.table_schema}}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>表名:</td>
                                        <td>
                                            {{info.exportInfo.table_name}}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>负责人:</td>
                                        <td>
                                            {{info.exportInfo.manager}}
                                        </td>
                                    </tr>
                                    <tr style="height: 70px;">
                                        <td>脚本:</td>
                                        <td>
                                            <textarea style="width: 361px; height: 96px;"
                                                      ng-model="info.exportInfo.script"></textarea>
                                        </td>
                                    </tr>
                                    <tr style="height: 70px;">
                                        <td>说明:</td>
                                        <td>
                                            <textarea style="width: 361px; height: 96px;"
                                                      ng-model="info.exportInfo.remark"></textarea>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>创建人:</td>
                                        <td>
                                            {{info.exportInfo.createdby}}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>创建时间:</td>
                                        <td>
                                            {{info.exportInfo.created | date:'yyyy-MM-dd HH:mm:ss'}}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>更新人:</td>
                                        <td>
                                            {{info.exportInfo.updatedby}}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>更新时间:</td>
                                        <td>
                                            {{info.exportInfo.updated | date:'yyyy-MM-dd HH:mm:ss'}}
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </uib-accordion-group>
                        </uib-accordion>
                        <div class="modal-footer">
                            <button class="btn btn-warning" type="button" ng-click="save()">保存</button>
                            <button class="btn btn-warning" type="button" ng-click="cancel()">关闭</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</script>
<script type="text/ng-template" id="ProdClean.html">
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header" style="margin-top:1px;">
                        <table width="95%">
                            <tbody>
                            <tr style="width: 200px;">
                                <td> 数据库:</td>
                                <td>
                                    {{info.baseInfo.table_schema}}
                                </td>
                                <td>表名:</td>
                                <td>
                                    {{info.baseInfo.table_name}}
                                </td>
                            </tr>
                            <tr>
                                <td>负责人:</td>
                                <td colspan="3">
                                    {{info.baseInfo.manager}}
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <div class="col-xs-2">
                            <input type="checkbox" style="margin-left: 2%;" data-ng-model="info.isNeedClean"
                                   ng-true-value="true" ng-false-value="false" ng-click="updateTableClean();"/>设为无需检查
                        </div>
                        <div class="col-xs-2">
                            <img src="/beetle/image/icon_plus-box.png" ng-click="add();" style="cursor: pointer;">
                        </div>
                    </div>
                    <div class="box-body" style="max-height: 500px;overflow-y: auto;">
                        <table class="table table-hover table-bordered text-center">
                            <thead>
                            <tr>
                                <th width="">
                                    脚本
                                </th>
                                <th>
                                    说明
                                </th>
                                <th>
                                    有效
                                </th>
                                <th>
                                    排序
                                </th>
                                <th>
                                    创建人
                                </th>
                                <th>
                                    创建日期
                                </th>
                                <th>
                                    更新人
                                </th>
                                <th>
                                    更新日期
                                </th>
                                <th>
                                    操作
                                </th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="i in info.cleanList">
                                <td>
                                    <textarea style="width: 260px; height: 96px;"
                                              ng-model="i.script"></textarea>
                                </td>
                                <td>
                                    <textarea style="width: 260px; height: 96px;"
                                              ng-model="i.remark"></textarea>
                                </td>
                                <td>
                                     <span ng-if="i.is_active == 'Y' ">
                                        <a href="javascript:void(0)" ng-click="changeActive(i,'N');"
                                           style="color: #00a65a;"
                                           class="btn-link" type="button">
                                            有效
                                        </a>
                                    </span>
                                    <span ng-if="i.is_active != 'Y' ">
                                        <a href="javascript:void(0)" ng-click="changeActive(i,'Y');"
                                           style="color: #c9302c;"
                                           class="btn-link" type="button">
                                            无效
                                        </a>
                                    </span>
                                </td>
                                <td>
                                    <input type="text" ng-model="i.sort" style="width: 50px;"/>
                                </td>
                                <td>
                                    {{i.createdby}}
                                </td>
                                <td>
                                    {{i.created | date:'yyyy-MM-dd HH:mm:ss'}}
                                </td>
                                <td>
                                    {{i.updatedby}}
                                </td>
                                <td>
                                    {{i.updated | date:'yyyy-MM-dd HH:MM:ss'}}
                                </td>
                                <td>
                                    <button class="btn btn-warning" type="button" ng-click="save(i)">保存</button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="box-footer">
                        <button class="btn btn-warning" type="button" ng-click="cancel()">关闭</button>
                    </div>
                </div>
            </div>
        </div>
    </section>
</script>
<script type="text/ng-template" id="ProdCheckRow.html">
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header" style="margin-top:1px;">
                        <table width="95%">
                            <tbody>
                            <tr style="width: 200px;">
                                <td> 数据库:</td>
                                <td>
                                    {{info.checkInfo.table_schema}}
                                </td>

                            </tr>
                            <tr>
                                <td>表名:</td>
                                <td>
                                    {{info.checkInfo.table_name}}
                                    <input type="checkbox" style="margin-left: 2%;" data-ng-model="info.isCheckRows"
                                           ng-true-value="true" ng-false-value="false"
                                           ng-click="updateTableCheck();"/>设为无需检查
                                </td>
                            </tr>
                            <tr>
                                <td>负责人:</td>
                                <td>
                                    {{info.checkInfo.manager}}
                                </td>
                            </tr>
                            <tr>
                                <td>当前行数:</td>
                                <td>
                                    {{info.checkInfo.this_rows}}
                                </td>
                            </tr>
                            <tr>
                                <td>已确认行数:</td>
                                <td>
                                    <input type="text" ng-model="info.checkInfo.checked_rows" style="width: 50px;"/>
                                </td>
                            </tr>
                            <tr>
                                <td>已确认日期:</td>
                                <td>
                                    {{info.checkInfo.checked_date | date:'yyyy-MM-dd HH:MM:ss'}}
                                </td>
                            </tr>
                            <tr>
                                <td>说明:</td>
                                <td>
                                    <textarea style="width: 260px; height: 96px;"
                                              ng-model="info.checkInfo.remark"></textarea>
                                </td>
                            </tr>
                            <tr>
                                <td>确认人:</td>
                                <td>
                                    {{info.checkInfo.checkedby}}
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div>
                        <span style="color: red;margin-left: 10px;">
                            注：确认行表示生产新增的配置项已经维护了相应的导出、清洗、初始化脚本。不会造成环境不可用.
                        </span>
                    </div>
                    <div class="box-footer">
                        <button class="btn btn-warning" type="button" ng-click="save()">保存</button>
                        <button class="btn btn-warning" type="button" ng-click="cancel()">关闭</button>
                    </div>
                </div>
            </div>
        </div>
    </section>
</script>